import request from '@/utils/axios'

/**
 * @param {Object} id
 * @param {Object} status更改轮播图状态
 */
export function changeCarouselStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/carousel/changeStatus',
    method: 'put',
    data
  })
}

/**
 * @param {Object} id
 * @param {Object} status更改轮播图是否打开新窗口
 */
export function changeCarouselTarget(id, target) {
  const data = {
    id,
    target
  }
  return request({
    url: '/system/carousel/changeTarget',
    method: 'put',
    data
  })
}

// 新增轮播图
export function addCarousel(data) {
  return request({
    url: '/system/carousel',
    method: 'post',
    data
  })
}

// 编辑轮播图
export function updateCarousel(data) {
  return request({
    url: '/system/carousel',
    method: 'put',
    data
  })
}
